#pragma once

#include <AVUIPanel.h>

namespace AVUI {

class DockPanel : public Panel
{
public:
    DockPanel() { };
    ~DockPanel() { };

    DECLARE_ELEMENT(DockPanel, Panel);

    DECLARE_DEPENDENCY_PROPERTY(Dock);

    DECLARE_DEPENDENCY_PROPERTY(LastChildFill);
    bool get_LastChildFill() { return AVUI::UnboxValue<bool>(GetValue(get_LastChildFillProperty())); }
    void set_LastChildFill(bool value) { SetValue(get_LastChildFillProperty(), AVUI::BoxValue(value)); } 

    Size MeasureOverride(const Size& constraintSize);
    Size ArrangeOverride(const Size& constraintSize);

    static Dock::Enum GetDock(UIElement* pElement) { return (Dock::Enum) UnboxValue<int>(pElement->GetValue(get_DockProperty())); }
    static void SetDock(UIElement* pElement, Dock::Enum dock) { return pElement->SetValue(get_DockProperty(), BoxValue<int>(dock)); }

private:
    static void StaticConstructor();
    static void OnDockChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e);

};


}; // namespace AVUI
